package com.itcast.hateoas.demo.stock.repository;

import com.itcast.hateoas.demo.stock.entity.StocksEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import java.util.List;

@RepositoryRestResource(path = "/stocks")
public interface StocksRepository extends JpaRepository<StocksEntity,Long> {

    /**
     * 根据名称查询股票信息
     * @param name
     * @return
     */
    public StocksEntity findByName(@Param("name") String name);

    /**
     * 根据股票名称查找所对应的股票数据
     * @param list
     * @return
     */
    List<StocksEntity> findByNameInOrderById(@Param("list") List<String> list);
}
